package com.cgt.common.exception;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 自定义异常类
 */
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class XiaoTaoException extends RuntimeException{
    @ApiModelProperty(value = "状态码")
    private Integer code;

    public XiaoTaoException(String msg) {
        super(msg);
        this.code = 0;
    }
    public XiaoTaoException(String msg, Throwable cause) {
        super(msg, cause);
        this.code = 0;
    }
    public XiaoTaoException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }
    public XiaoTaoException(Integer code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
    }
    public int getStatus() {
        return 500;
    }
}
